<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = new Array();
        arr = ['suliang','xiaoming']

        // console.log(arr);
        // console.log(arr.length)
        // //遍历数组对象
        // for(var i=0 ;i<arr.length;i++){
        //     console.log(arr[i])
        // }

        // console.log(arr);
        // //设置数组长度为10
        // arr.length = 10;
        // console.log(arr);
        // //设置数组长度为2
        // arr.length = 2;
        // console.log(arr);
        // //返回数组长度
        // console.log(arr.length);

        console.log(arr);
        arr[arr.length] = 'xiaohu';
        arr[arr.length] = 'gala';
        arr[arr.length] = 'wei';
        console.log(arr);
    </script>
</head>
<body>
    
</body>
</html>